<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript">

$(function(){
	$('tr:odd').css('backgroundColor','#81bceb');
});
</script>

</head>
<body>
<div style="width:400px;margin: 0 auto;">
	<h1>工作笔记</h1>
	<a href="add.jsp">添加笔记</a>
	<table border="1">
		<tr>
			<th>笔记标题</th>
			<th>笔记分类</th>
			<th>编写时间</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${list }" var="work">
			<tr>
			<td>${work.title }</td>
			<td>
				<c:if test="${work.type == 1 }">技术</c:if>
				<c:if test="${work.type == 2 }">行政</c:if>
				<c:if test="${work.type == 3 }">人事</c:if>
			</td>
			<td>${work.createDate.substring(0, 10) }</td>
			<td>
				<a href="ViewServlet?id=${work.id }">查看</a>
			</td>
		</tr>
		</c:forEach>
		
	</table>
</div>
</body>
</html>